home *** CD-ROM | disk | FTP | other *** search
- /* Sample arexx client program for iX-Guide */
- /* How to make scrolling object which takes */
- /* care of changing documents, screens ... */
- /* NOTE: never write programs which perform */
- /* some graphics operations for a long period */
- /* of time without using delay() */
-
- if show('p',"IXCL_3") then exit
-
- if ~show('l', "rexxsupport.library") then
- addlib('rexxsupport.library',0,-30,0)
-
- OPTIONS RESULTS
-
- txt.1 = '" Scrolling text "'
- txt.2 = '" -------------------- "'
- txt.3 = '"This is demo of Arexx "'
- txt.4 = '" controled object. "'
- txt.5 = '" To stop scrolling "'
- txt.6 = '" press STOP button "'
- txt.7 = '" and START button to "'
- txt.8 = '" start again "'
- txt.9 = '" -------------------- "'
-
- ADDRESS IXGUIDE
- AddClient
- portname = 'IXCL_3'
- call openport(portname)
- setport portname MISC
- AllocRaster 2
- rp=result
- refresh rp
- SetABPen rp 1 0
-
- OpenFont 'times.font' 18; f1 = result
- OpenFont 'topaz.font' 8; f2 = result
- SetDrMd rp 0
-
- shutdown=0
- flag=0
- stopscroll=0
- contscroll=0
- ypos = 120
- linecnt = 1
-
- do until shutdown
- call waitpkt(portname)
- msg = getpkt(portname)
-
- if msg ~= '0000 0000'x then do
- class = getarg(msg)
-
- if class = 'MISC' then do
- a1 = getarg(msg,1)
-
- if a1 = 'QUIT' then shutdown=1
-
- if a1 = 'LINKREQ' then do
- a2 = getarg(msg,2)
- if a2 = 'rx_start' then do
- flag=1 /* we should start scrolling */
- stopscroll=0
- end
- end /*end if LINKREQ*/
-
- if (a1 = 'LINKOK') | (a1 = 'LINKFAILED') then
- if contscroll then do
- a2 = getarg(msg,2)
- a3 = getarg(msg,3)
- if (a2='iX-Guide.ixml') & (a3='arexx_demo') then do
- flag=1
- stopscroll=0
- contscroll=0
- end
- end
-
- if (a1 = 'OLDSCREEN') | (a1 = 'NEWSCREEN') then
- if contscroll then do
- flag=1
- stopscroll=0
- contscroll=0
- end
-
- end /*end if class==MISC*/
- call reply(msg,0)
- end /*end if msg*/
-
- if flag=1 then do /* should we start scrolling? */
- do until stopscroll
- call scroll()
- call delay(1)
- call checkinput()
- end /*end until stopscroll*/
- flag=0
- end /*end if flag==1*/
- end /*end until shutdown*/
-
- /* clean up */
- CloseFont f1; CloseFont f2
- FreeRaster rp
- RemClient
- call closeport(portname)
- exit
-
- checkinput:
- cimsg = getpkt(portname)
- do while cimsg ~= '0000 0000'x
- ciclass = getarg(cimsg)
- if ciclass = 'MISC' then do
- cia1 = getarg(cimsg,1)
-
- if cia1 = 'QUIT' then do
- stopscroll=1
- shutdown=1
- end
-
- if cia1 = 'LINKREQ' then do
- stopscroll=1
- cia2 = getarg(cimsg,2)
- if cia2 ~= 'rx_stop' then contscroll=1
- call reply(cimsg,0)
- return 0
- end
-
- if cia1 = 'ASKSCREEN' then do
- stopscroll=1
- contscroll=1
- call reply(cimsg,0)
- return 0
- end
-
- end /*end if 'MISC'*/
- call reply(cimsg,0)
- cimsg = getpkt(portname)
- end /*end do while cimsg*/
- return 0
-
- scroll:
- ypos = ypos - 1
- if ypos<110 then do
- ypos = 120
- linecnt=linecnt+1
- if linecnt>9 then linecnt=1
- end
- ScrollRaster rp 0 1 0 0 197 178
- if linecnt=1 then SetABPen rp 2
- else SetABPen rp 1
- if linecnt=1 then do
- SetFont rp f1
- Move rp 30 ypos+2
- Text rp txt.linecnt
- end
- else do
- SetFont rp f2
- Move rp 10 ypos
- Text rp txt.linecnt
- end
- return 0
-